---
category: Date Time
created: '2020-05-05'
title: Get the weekday of a date
updated: '2021-10-13'
---

**JavaScript version**

```js getWeekday.js
// `date` is a Date object
const getWeekday = (date) =>
    ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
```

**TypeScript version**

```ts getWeekday.ts
const getWeekday = (date: Date): string =>
    ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
```
